// 新闻接口

import request from "@/util/request";

export function list(param) {
    return request({
        url: '/news',
        method: 'get',
        params: param
    })
}

export function saveOrUpdate(news) {
    return request({
        url: '/news',
        method: 'post',
        data: news
    })
}

export function getById(newsId) {
    return request({
        url: '/news/getById/' + newsId,
        method: 'get'
    })
}

export function deleteNews(newsId) {
    return request({
        url: '/news/delete',
        method: 'delete',
        params: {
            id: newsId
        }
    })
}

export function uploadCover(data) {
    return request({
        url: '/news/uploadCover',
        method: 'post',
        data: data
    })
}